package com.tangyuan.feignapis.user;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.tangyuan.common.result.Result;
import com.tangyuan.dto.UserActionByUserIdDto;
import com.tangyuan.dto.UserActionDto;
import com.tangyuan.model.UserAction;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.Date;
import java.util.List;

@FeignClient(name = "service-user",contextId = "userAction")
public interface IUserActionFeignClient {

    @PostMapping("/feignApi/user/getUserAction")
    Result<String> getUserAction(@RequestBody UserActionDto dto);

    @GetMapping("/feignApi/user/getAllUserMovieId")
    List<Long> getAllUserMovieId();

    @PostMapping("/feignApi/user/getUserActionByUserIdDto")
    List<Long> getUserActionByUserIdDto(@RequestBody UserActionByUserIdDto userActionByUserIdDto);

    @GetMapping("/feignApi/user/getUserActionByUserId")
    List<Long> getUserActionByUserId(@RequestParam Long userId);

    @GetMapping("/feignApi/user/getPageUserActionByUserId")
    Page<UserAction> getPageUserActionByUserId(@RequestParam Long userId,@RequestParam Integer pageNum,@RequestParam Integer pageSize);

    @PostMapping("/feignApi/user/addUserAction")
    void addUserAction(@RequestParam(value = "userId") Long userId, @RequestParam(value = "movieId") Long movieId);

    @GetMapping("/feignApi/user/getAllUserId")
    List<Long> getAllUserId();

    @GetMapping("/feignApi/user/getUserActionCollection")
    List<UserAction> getUserActionCollection();

    @PostMapping("/feignApi/user/deleteUserAction")
    void deleteUserAction();

    @GetMapping("/feignApi/user/selectUserActionList")
    List<UserAction>   selectUserActionList(@RequestParam(value = "userId") Long userId,@RequestParam(value = "sort",required = false) String sort);

    @GetMapping("/feignApi/user/selectUserActionListByDistinct")
    List<UserAction> selectUserActionListByDistinct();

    @PostMapping("/feignApi/user/view")
    void view(@RequestBody UserAction userAction);

    @GetMapping("/feignApi/user/getYesterdayUserActionData")
    List<UserAction> getYesterdayUserActionData(@RequestParam(required = false) Date time);
}
